<?
layout("/inc/win_layout.html",{title:sysTitle}){
    ?>
<div id="page-wrapper" style="margin-left: 0px;">
       
      <!--BEGIN CONTENT-->
      <div style="height: 390px;overflow: auto;">
		<table
			class="table table-hover table-striped table-bordered table-advanced tablesorter mbn">
			<thead>
				<tr>
					<th ></th>
					<th >序号</th>
					<th >英文名称</th>
					<th >中文名称</th>
					<th >字段名称</th>
					
				</tr>
			</thead>
			<tbody id="findallDictItem"></tbody>
		</table>
		<div id="dataNull" class="panel-body"
				style="height: 90px; line-height: 50px;" align="center">
				<span class='subtitle' style="font-size: 15px;">数据为空!</span>
		</div>
		<div id="page2" style="text-align: center; margin-top: 20px;"></div>
	</div>

	<!--END CONTENT-->
</div>

<?} ?>
<!-- 
<iframe name="child" src="dictItem-add-updateBiao.html" id="ifr" style="HEIGHT: 0px; LEFT: 0px; POSITION: absolute;  WIDTH: 0px"></iframe>
 -->
<script>
function getQueryString(name) { 
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
	var r = window.location.search.substr(1).match(reg); 
	if (r != null) return unescape(r[2]); return null; 
	} 
	var winName=getQueryString("winName");
	
var relevanceClassesId = window.parent.window[winName].gradeFields();
var selectname = window.parent.window[winName].getselectname();

 $(function(){
 	demo1();
 
}); 
	function demo1() {
	 $.ajax({  
                type : "post",  
                url : "./KnowledgeDataPropertyList.do",  
                data : {"lid":relevanceClassesId},
                dataType : "json",   
                success : function(data) { 
                  var str = "";
							$("#findallDictItem").html("");		
			if(data.length>0){
					$("#dataNull").hide();
				}else{
					$("#dataNull").show();
				}		
							for ( var i = 0; i < data.length; i++) {
							var namew=data[i].name+","+data[i].id;
								str += "<tr><td> <input type=\"checkbox\"  id="+ data[i].id + " name=\"check\" value="+namew+"  />"
								+ "</td>"
								+"<td>"+ (i+1)+ "</td>"
								+"<td>"+ data[i].name + "</td>"
								+"<td>"+ data[i].nameen + "</td>"
								+"<td>"+ data[i].field + "</td>"
								+ "</tr>";
								
							}	
								$("#findallDictItem").append(str);
									if(selectname!=null){
                                        select();}
                },
	            error : function(data) {
                   alert("请求失败");
		        }
            }); 
			
	};
	function  select(){
	var kk=selectname.split(",");
	for(var i=0;i<kk.length;i++)
	{

	document.getElementById(kk[i]).checked=true;
	
	}
	}
	function  save(){
		var check = document.getElementsByName("check");
			var Fields="";
			var Fieldsname="";
			for(var i=0;i<check.length;i++){
				if(check[i].checked){
				var kk=check[i].value.split(",");
					Fields+=kk[1]+",";
					Fieldsname+=kk[0]+",";
				}
			}
			
			Fields=Fields.substring(0, Fields.length-1);
			Fieldsname=Fieldsname.substring(0, Fieldsname.length-1);
			var index = parent.layer.getFrameIndex(window.name); 
	       window.parent.window[winName].$("#Fieldsname").val(Fieldsname);
	        window.parent.window[winName].$("#relevanceClassFields").val(Fields);
	       parent.layer.close(index);
		
	    
     }

</script>